#ifndef __MESSAGE_QUEUE_H__
#define __MESSAGE_QUEUE_H__
#include "wait_queue.h"
#include "time.h"

typedef struct queue{
        unsigned char *head;
        unsigned char *tail;
        unsigned char *start;
        unsigned char *end;
        unsigned int max_length;
        unsigned int length;
        unsigned int elementSize;
        struct list_head tasksPost;
        struct list_head tasksPend;
} queue;

queue *queueCreate(unsigned int max_size, unsigned int elementSize);
err_t queueSendToTail(queue *q, void *msg);
//err_t queueSendToHead(queue *q, void *msg, int timeout);
err_t queueReceive(queue *q, void *buff, int timeout);
static void queueGetMessage(void *buff, queue *q);

#endif
